[WIP] enable WebGPU EP in WebAssembly build #23697
Draft
+1,998
−391
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
(This change is still WIP.)
This PR includes the changes that allows building WebAssembly with WebGPU EP.
Important development/debug guide
Currently, this PR includes 2 parts of changes:
enable WebGPU EP in WebAssembly build: the feature implementation.
easier debugging for integration: some changes that helps debugging and development. Those changes are not going to be merged.
ort.bundle.mjs
instead ofort.bundle.min.js
. this is much easier to debug in browser.globalThis["WEBGPU_EP"]
to1
to use a WebGPU EP implementation.globalThis["WEBGPU_STAT"]
to1
.Example:
How to build:
build_jsep.bat
withbuild_webgpu.bat
.the build will generates web assembly file that contains both JSEP and WebGPU EP. this helps testing because wasm build usually takes very long to complete.npm test -- ... npm run build npm pack
--no-webgpu-ep
:npm test --no-webgpu-ep -- ... npm run build --no-webgpu-ep npm pack --no-webgpu-ep
dawn.patch
This patch includes file changes from the following bugfixes/workarounds:
Emscripten patch
A file copy opearation is performed to update a few files in Emscripten. Including following changes:
known test failures
Those test cases need to be fixed: